<!DOCTYPE HTML>
<html>
<head>

    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title>读书会简介</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="/css/uploadifive.css">
    <link type="text/css" rel="stylesheet" href="/js/plugins/layer/laydate/skins/default/laydate.css" id="LayDateSkin">

</head>
<body>
<h2>添加</h2>
<!--style给定宽度可以影响编辑器的最终宽度-->

<!--style给定宽度可以影响编辑器的最终宽度-->
<form id="FORM_validate" action="/article/update" method="post">
    <input id="form_Id" type="hidden" value="{{.Article.Id}}" name="Id">
    <div class="">

        <input type="hidden" value="{{date .Article.CreateTime "Y-m-d H:i:s"}}" name="createtime">
        <div class="form-group col-md-12">
            <label class="col-md-12 control-label">读书会介绍：</label>
            <div class="col-md-12">
                <script type="text/plain" id="myEditor_Content" name="Content" style="width:100%;"></script>
            </div>
        </div>
        <input type="hidden" name="ArticleType" value="3">

        <input type="hidden" value="{{.Article.UserId}}" name="UserId">
        <input type="hidden" value="{{.Article.CityId}}" name="CityId">

        <div class="form-group col-md-12">
            <div class="col-md-12 col-md-offset-3">
                <button class="btn btn-white" type="submit">更新</button>
            </div>
        </div>
    </div>
</form>


<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/jquery.uploadifive.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="/js/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/ueditor.all.min.js"></script>
<script type="text/javascript" src="/lang/zh-cn/zh-cn.js"></script>
<script src="/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/js/plugins/validate/messages_zh.min.js"></script>


<!-- jQuery UI -->
<script src="/js/jquery-ui-1.10.4.min.js"></script>
<!-- laydate js -->
<script src="/js/plugins/layer/laydate/laydate.js"></script>

<!--form validate-->
<script>
    $().ready(function () {
        // validate the comment form when it is submitted
        $("#FORM_validate").validate({
            rules: {
                Title:{
                    required:true,
                    minlength: 2
                }
            }
        });
    });
</script>

<!--pic upload-->
<script type="text/javascript">
    $(function () {

        $('#file_upload_ListPicPath').uploadifive({
            'formData': {
                'Id': $("#form_Id").attr("value"),
                'imagepath': $("#form_ListPicPath").attr("value")
            },
            'uploadScript': '/article/picUp',
            'fileTypeExts': '*.jpg; *.jpeg; *.png',
            'removeCompleted' : true,
            'buttonClass':"btn-info",
            'multi': false,
            'onUploadComplete' : function(file, data) {
                var url_new = $.parseJSON(data).Data;
                $("#form_pic_ListPicPath").attr("src", url_new);
                $("#form_ListPicPath").attr("value", url_new.substring(0, url_new.indexOf("?time")));
            },
            'onUploadError': function (file, errorCode, errorMsg, errorString) {
                alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
            }
        });

    });
</script>

<!--实例化编辑器-->
<script type="text/javascript">
    var ue = UE.getEditor('myEditor_Content', {
        autoHeightEnabled: true,
        autoFloatEnabled: true,
        textarea: "Content",
        initialContent:{{.Article.Content}}
    });
</script>


</body>
</html>